package cn.sccl.common.model;

/**
 * 分页查询参数，所有做分页查询的方法，必须传入该参数
 * Created by 杨浩宇 on 2016-02-16.
 */
public class PageQueryData extends QueryData {
    private long pageIndex = 1;

    private int pageSize = 20;

    private long start = 0;

    private long resultTotal = 0;

    private boolean enablePage = false;

    public PageQueryData(long pageIndex, int pageSize) {
        this.pageIndex = pageIndex;
        this.pageSize = pageSize;
        this.start = (pageIndex - 1) * pageSize;
    }

    public long getPageIndex() {
        return pageIndex;
    }

    protected void setPageIndex(long pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getPageSize() {
        return pageSize;
    }

    protected void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public boolean isEnablePage() {
        return enablePage;
    }

    public void setEnablePage(boolean enablePage) {
        this.enablePage = enablePage;
    }

    public long getResultTotal() {
        return resultTotal;
    }

    public void setResultTotal(long resultTotal) {
        this.resultTotal = resultTotal;
    }

    public long getStart() {
        return start;
    }

    public void setStart(long start) {
        this.start = start;
    }
}
